package com.miao.service.impl;

import com.miao.dao.OrderDetailDao;
import com.miao.entity.OrderDetail;
import com.miao.service.OrderDetailService;
import com.miao.util.BeanCopyUtil;
import com.miao.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 苏泓权
 * 文件名：OrderDetailServiceImpl
 * 创建时间：2023/3/13 14:24
 * 描述:TODO
 */
@Service
public class OrderDetailServiceImpl implements OrderDetailService {
    @Autowired
    OrderDetailDao orderDetailDao;


    @Override
    public ResultVo getOrderDetailId(Integer parttimeId) {

        OrderDetail orderDetail = orderDetailDao.selectOrderDetailById(parttimeId);
        BeanCopyUtil.copyProperties(orderDetail,ResultVo.class);
        return ResultVo.success(ResultVo.class);

    }

    @Override
    public ResultVo editOrderDetailId(Integer parttimeId) {
        OrderDetail orderDetail= orderDetailDao.editOrderDetailById(parttimeId);
        BeanCopyUtil.copyProperties(orderDetail,ResultVo.class);
        return ResultVo.success(ResultVo.class);
    }

    @Override
    public ResultVo deleteOrderDetailId(Integer parttimeId) {
        int orderDetail = orderDetailDao.deleteOrderDetailById(parttimeId);
        BeanCopyUtil.copyProperties(orderDetail,ResultVo.class);
        return ResultVo.success(ResultVo.class);
    }

}
